from flake8.api import legacy as flake8


def check_code_with_flake8(file_path):
    style_guide = flake8.get_style_guide()
    report = style_guide.input_file(file_path)
    if report.total_errors:
        print(report.total_errors)
    else:
        print("Code passed flake8 checks")


if __name__ == "__main__":
    check_code_with_flake8("./flake_test.py")
